<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>我的佣金_frm</title>
        <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
        <meta content="yes" name="apple-mobile-web-app-capable"/>
        <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
        <meta content="telephone=no" name="format-detection"/>
        <link href="../Ryancss/yongjin.css" rel="stylesheet" type="text/css"/>
        <script type="text/javascript" src="../Ryanjs/yongjin/jquery.min.js"></script>
        <script type="text/javascript" src="../Ryanjs/yongjin/slider.js"></script>
		<script type="text/javascript" src="../script/movie.js"></script>	
		
			<style type="text/css">

		.showbig{
			display: block;
			height: 50px;
			background-color: #eaeaea;
			color: #E91E63;
			border: none;
			border-radius: 20px;
			width: 48%;
			margin: 0 auto;
			display: block;
			height: 2.5rem;
			line-height: 2.5rem;
			
			margin-bottom: 10px;
		}
		
			.showbig_zfb{
			display: block;
			height: 50px;
			background-color: #eaeaea;
			color: #E91E63;
			border: none;
			border-radius: 20px;
			width: 80%;
			margin: 0 auto;
			display: block;
			height: 2.5rem;
			line-height: 2.5rem;
			
			margin-bottom: 10px;
		}	
		
		input{
			display: block;
			height: 100%;
			outline: none;
			border: none;
			text-indent: 20px;
		}
    

	   .display-block{
	   display :block ;
	   }
	   
	   .display-none{
	   display :none ;
	   }
	   
	   
		</style>
			
				
    </head>
    <body>




            <section class="aui-scrollView">
                <div class="aui-palace">
                    <a tapmode onClick="toTixian()" class="aui-palace-grid">
                        <div class="aui-palace-grid-icon">
                            <img src="">
                        </div>
                        <div class="aui-palace-grid-text">
                            <h2>提现记录</h2>
                        </div>
                    </a>
                    <a tapmode onClick="openyongjinlog()" class="aui-palace-grid">
                        <div class="aui-palace-grid-icon">
                            <img src="">
                        </div>
                        <div class="aui-palace-grid-text">
                            <h2>佣金明细</h2>
                        </div>
                    </a>
                    <a tapmode onClick="toShare()" class="aui-palace-grid">
                        <div class="aui-palace-grid-icon">
                            <img src="">
                        </div>
                        <div class="aui-palace-grid-text">
                            <h2>分享赚钱</h2>
                        </div>
                    </a>
                </div>
				
				
				
				
				
	   
				<div  tapmode onClick="toTixian()"  class="display-none" id="display-block-Txjilu" >
				
					 <div class="divHeight"></div>  
					 
					 <div class="aui-flex" style="padding-bottom:0">   
					 <div class="aui-mas-img">   
					 <img src="">   
					 </div>  
					 <div class="aui-flex-box">   
					 <h3 >      佣金提现 <em>记录</em>       </h3>  
					 </div>  
					 
					 <div class="aui-arrow">  
					 <p  >正在审核</p>      
					 </div>   
					 
					 </div>        
					 
					 <div class="aui-flex">   
						 <div class="aui-text-fl">     
						 <h1 id="txje">¥ 0</h1>    
						 <h2  >提现冻结(元) </h2>   
						 </div>   
						 <div class="aui-flex-box">   
						 <h5  >预计 <em>72小时内</em> 内到账 请注意查收！</h5>   
						 </div>
					 </div>
	
				</div >
								
				
				
				
				
				
				
                <div class="divHeight"></div>
				
				
                <div class="aui-mas-title">
                    <img src="">
                </div>
				<div class="aui-mas-text">
                 <!--      <p>我的佣金(元)</p>-->
                </div> 
                <div class="aui-mas-line">
                    <h1 id="money">0</h1>
                </div>
				
				
	


<input type="number" class="showbig" name=""  id="count"  onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'10')}else{this.value=this.value.replace(/\D/g,'10')}" onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'10')}else{this.value=this.value.replace(/\D/g,'10')}"  min="1" value="10" placeholder="输入金额" />

<div class="aui-mas-button">    <button tapmode onclick="tixian()" >立即提现</button>		</div>
 


				<div  class="display-none" id="display-block-zfbok" >
					<div class="divHeight"></div>	
					 
					 <div class="aui-flex" style="padding-bottom:0">   
					 <div class="aui-mas-img">   
                        <img src="">
					</div>  
					 <div class="aui-flex-box">   
					 <h3 >当前佣金提现账户 <em>支付宝</em>       </h3>  
					 </div>  
					 
					 <div class="aui-arrow"  tapmode onclick="admin_service()" >  
					 <p>修改 <!--联系管理员--></p>      
					 </div>   
					 
					 </div>        
					 
					 <div class="aui-flex">   
						 <div class="aui-text-fl">     
						 <h3 id="zfb_name"></h3>    
						 <h2  id="zfb"></h2>   
						 </div>   
						 <div class="aui-flex-box">   
						 <h5  ><em>提示：</em> 支付宝账户和对应实名认证姓名不匹配将无法正常到账！</h5>   
						 </div>
					 </div>
				</div>

				
					 <div class="divHeight"></div> 
					 
		<div  class="display-none" id="display-block-zfb" >
                <div class="aui-flex" style="padding-bottom:0">
                    <div class="aui-mas-img">
                        <img src="">
                    </div>
                    <div class="aui-flex-box"> 
                        <h3>提现支付宝账户设置 </h3>
                    </div>

                </div>
		
			
			

					<div style="text-align:center;padding-top:1rem;position: relative;" >
			
							<input type="text" class="showbig_zfb" name=""  id="Alipay"  placeholder="输入账户" />
								
							<input type="text" class="showbig_zfb" name=""  id="Alipay_name"  placeholder="姓名" />

							<div class="aui-mas-button">    <button tapmode onclick="Alipay_settings()" >保存</button>		</div>
							 


					</div>

		</div>

				
				

				
				
            </section>



    </body>
	
	
	
<script type="text/javascript" src="../script/api.js"></script>

<script type="text/javascript">
	var api_url = localStorage.getItem('api_url');

	apiready = function(){
  
  
  	    api.parseTapmode();
	
		
	/*	
				api.showProgress({
				    title: '正在加载',
				    text: '请稍等',
				    modal: false
				});
				
 	*/

		getYongjin_frm();				//获取数据
		
			
			// 网络状态
		api.addEventListener({
			name:'offline'
		}, function(ret, err){        

			api.toast({
			msg : '网络连接异常',
			duration : 5000,
			location : 'middle' 
			});

			  

		});

		api.addEventListener({
			name:'online'
		}, function(ret, err){        
		
			  api.toast({
			  msg : '已经连接网络',
			  duration : 2000,
			  location : 'middle' 
			  });
				  

    getYongjin_frm();				//获取数据

				  
		});	

	}



	// 我的佣金 数据获取
	function getYongjin_frm(){
	var ikmovie="";
	api.ajax({
        url: api_url+'/login/login/yongjin_frm.html',
        method: 'get',
		dataType: 'text',
        data: {
            values: {
				key: 'p2piunink',   //安全码
                uid: localStorage.getItem('user_id')
            }
        }
    },function(ret, err){
        if(ret) { 
			
			                                                var result="";
															ikmovie=getValue(ret);
		                                                 	result=ikmovieb(ikmovie);
															ret=json(result);
            localStorage.setItem('money',ret.msg['money']);	//余额
            localStorage.setItem('txje',ret.msg['txje']);	//提现金额
            localStorage.setItem('zfb',ret.msg['zfb']);		//支付宝
            localStorage.setItem('zfb_name',ret.msg['zfb_name']);		//支付宝姓名
            localStorage.setItem('status',ret.msg['status']);	//账户封号状态
			
			money.innerHTML = '¥ '+localStorage.getItem('money');    //可用余额
			
			
           	if (localStorage.getItem('txje') > '0'){			//  如果有当前有提现记录
				var obj = document.getElementById("display-block-Txjilu");
				obj.setAttribute("class", "display-block");
				
				txje.innerHTML = '¥ '+localStorage.getItem('txje');    //当前正在提现金额
            }
			

			
           	if (localStorage.getItem('zfb') == ''){			//  如果没有设置支付宝  就显示设置窗口
				var obj = document.getElementById("display-block-zfb");
				obj.setAttribute("class", "display-block");
				
            }else{											// 如果已经设置就显示 当前值
			
			
				var obj = document.getElementById("display-block-zfb");			//设置过后隐藏
				obj.setAttribute("class", "display-none");
			
				var obj = document.getElementById("display-block-zfbok");
				obj.setAttribute("class", "display-block");
				
				
				zfb.innerHTML = localStorage.getItem('zfb');    
				zfb_name.innerHTML = localStorage.getItem('zfb_name');   
			
			}


			
			api.hideProgress();	
        }else{
			api.hideProgress();

            api.toast({
                msg: '网络错误',
                duration: 5000,
				location : 'middle' 
            });


        }
    });
   
	}
	
	
	
// 处理提现	
function tixian(){

	
	var tx_jine = $api.val($api.byId('count'));			//输入提现金额
	
	
			api.showProgress({
			title: '提现处理',
			text: '请稍等',
			modal: false
		});
	  
	  
	api.ajax({
        url: api_url+'/login/login/yongjin_frm.html',
        method: 'get',
		dataType: 'text',
        data: {
            values: {
				key: 'p2piunink',   //安全码
                uid: localStorage.getItem('user_id'),
				tx_jine:tx_jine
            }
        }
    },function(ret, err){
        if(ret) { 
                                                             var result="";
															ikmovie=getValue(ret);
		                                                  	result=ikmovieb(ikmovie);
															ret=json(result);			
			if (ret.code == 718) {		//安全码错误
			
				api.toast({
					msg: ret.msg,
					duration: 2000,
					location : 'middle' 
				});
			
			}else if(ret.code == 888) {		//参数不正确
			
			Popup_ordinary('警告',ret.msg);						//普通弹窗提示
			
			}else if(ret.code == 666) {			// 余额不足
			
			Popup_Share_button('余额不足',ret.msg);				//带分享按钮弹窗提示
			
			}else if(ret.code == 555) {		// 最低提现额度
			
			Popup_Share_button('提现失败',ret.msg);				//带分享按钮弹窗提示
			
			}else if(ret.code == 0) {		// 错误
			
			Popup_ordinary('操作失败',ret.msg);						//普通弹窗提示
			
			}else if(ret.code == 1) {
					
			Popup_ordinary('恭喜您！',ret.msg);						//普通弹窗提示
			
					getYongjin_frm();					//提现申请提交成功 重新获取数据
					
					
					//传递数据
					 api.sendEvent({
					  name: 'newLoingdata',
					  extra: {
					  }
					});
			}
			
			
			
			api.hideProgress();	
        }else{
			api.hideProgress();

            api.toast({
                msg: '网络错误',
                duration: 5000,
				location : 'middle' 
            });


        }
    });
   
}	
	

  
  
  
  
  
  
  
  
  
  
  	
// 设置支付宝账户	
function Alipay_settings(){

	var Alipay = $api.val($api.byId('Alipay'));			//输入的支付宝账户
	var Alipay_name = $api.val($api.byId('Alipay_name'));			//输入的支付宝账户实名
	
	
		api.showProgress({
			title: '正在处理',
			text: '请稍等',
			modal: false
		});
	  
	  
	api.ajax({
        url: api_url+'/login/login/zfbcz_Ryan.html',
        method: 'get',
        data: {
            values: {
				key: 'p2piunink',   //安全码
                id: localStorage.getItem('user_id'),
				Alipay:Alipay,
				Alipay_name:Alipay_name
            }
        }
    },function(ret, err){
        if(ret) { 
			
					if (ret.code == 718) {		//安全码错误
					
						api.toast({
							msg: ret.msg,
							duration: 2000,
							location : 'middle' 
						});
					
					}else if(ret.code == 0) {		// 错误
					
					Popup_ordinary('操作失败',ret.msg);						//普通弹窗提示
					
					}else if(ret.code == 1) {
							
					Popup_ordinary('恭喜您！',ret.msg);						//普通弹窗提示
					
							getYongjin_frm();					//设置成功  重新获取数据 关闭设置
					
					//传递数据 更新积分
					 api.sendEvent({
					  name: 'newLoingdata',
					  extra: {
					  }
					});		

				}
					
			
			api.hideProgress();	
        }else{
			api.hideProgress();

            api.toast({
                msg: '网络错误',
                duration: 5000,
				location : 'middle' 
            });


        }
    });
   
}	
	

  
  
  
  
  
  
  
  
		//佣金明细
		function openyongjinlog() {

		api.openWin({
			name: 'yongjinlog_win',
			url: 'yongjinlog_win.html'
		});

		}


     //邀请分享
      function toShare(){

        api.openWin({
            name: 'share_win',
            url: 'share_win.html', 
        });

    }

  
 
     //提现记录
      function toTixian(){

        api.openWin({
            name: 'tixianlog_win',
            url: 'tixianlog_win.html', 
        });

    }

  
 	// 联系管理员
    function admin_service(){

        api.openWin({
            name: 'admin_service_win',
            url: 'setup/admin_service_win.html'
        });

    }
	
 

 
 
 
 
 //  带分享按钮的 弹窗提示
 function Popup_Share_button(title,content){
 
	var dialogBox = api.require('dialogBox');
	dialogBox.alert({
    texts: {  
        title: title,
        content: content,   //调用后台设置内容
        leftBtnTitle: '知道了',
        rightBtnTitle: '去赚钱'
    },
    styles: {
			bg: '#fff',
			w: 300,
			corner:10,
			title: {
				marginT: 20,
				icon: 'widget://Ryanimg/frame0/rrrr.png',
				iconSize: 20,
				titleSize: 14,
				titleColor: '#999'
			},
			content: { 
				marginT: 20,       //（可选项）数字类型；内容文本顶端与标题栏底端的距离，如果标题栏不存在，则是到窗口顶端的距离；默认：20
				marginB: 20,       //（可选项）数字类型；内容文本底端与 left/right 顶端的距离，如果 left/right 都不存在，则是到对话框底端的距离；默认：20
				color: '#999',
				size: 14 
			},
			left: {
				marginB: 30,
				marginL: 30,
				w: 100,
				h: 35,
				corner: 2,
				bg: '#eeeeee',
				color: '#999',  //（可选项）字符串类型；右边按钮标题字体颜色，支持rgb、rgba、#；默认：'#007FFF'
				size: 12
			},
			right: {
				marginB: 30,
				marginL: 40,
				w: 100,
				h: 35,
				corner: 2,
				bg: '#ff1679',
				color: '#fff',  //（可选项）字符串类型；右边按钮标题字体颜色，支持rgb、rgba、#；默认：'#007FFF'
				size: 12
			}
			
			
		
		}
	}, function(ret) {
						
																			
					if (ret.eventType == 'left') {
						var dialogBox = api.require('dialogBox');
						dialogBox.close({
							dialogName: 'alert'
						});
					} else if(ret.eventType == 'right') {
																			
						api.openWin({
						name: 'share_win',
						url: './share_win.html',
						delay: 300
					});
																					     
							    
						var dialogBox = api.require('dialogBox');
						dialogBox.close({
						dialogName: 'alert'
						});
																					
					}
				});
 
 }
 
 

 
 
 
 
 
 
 
 
 
 
 
 //  不带分享按钮的 弹窗提示
 function Popup_ordinary(title,content){
 
	var dialogBox = api.require('dialogBox');
	dialogBox.alert({
	tapClose:true,			//允许点击遮罩关闭弹窗
    texts: {  
        title: title,
        content: content,   //调用后台设置内容
        leftBtnTitle: '知道了'
    },
    styles: {
			bg: '#fff',
			w: 300,
			corner:10,
			title: {
				marginT: 20,
				icon: 'widget://Ryanimg/frame0/rrrr.png',
				iconSize: 20,
				titleSize: 14,
				titleColor: '#999'
			},
			content: { 
				marginT: 20,       //（可选项）数字类型；内容文本顶端与标题栏底端的距离，如果标题栏不存在，则是到窗口顶端的距离；默认：20
				marginB: 20,       //（可选项）数字类型；内容文本底端与 left/right 顶端的距离，如果 left/right 都不存在，则是到对话框底端的距离；默认：20
				color: '#999',
				size: 14 
			},
			left: {
				marginB: 30,
				marginL: 100,
				w: 100,
				h: 35,
				corner: 2,
				bg: '#eeeeee',
				color: '#999',  //（可选项）字符串类型；右边按钮标题字体颜色，支持rgb、rgba、#；默认：'#007FFF'
				size: 12
			}
			
		
		}
	}, function(ret) {
						
																			
					if (ret.eventType == 'left') {
						var dialogBox = api.require('dialogBox');
						dialogBox.close({
							dialogName: 'alert'
						});
					}
				});
 
 }
 
  
  
  


	</script>

</html>
